package com.boot.shiro.entity;

import javax.persistence.Column;

import com.boot.business.common.entity.AbstractEntity;

/**
 * 类名称：组织机构
 */
public class Department extends AbstractEntity{

	private static final long serialVersionUID = 4933236525673701122L;
	@Column(name = "name", columnDefinition = "varchar(32)  comment '组织名称'")
	private String name;			//名称
	
	@Column(name = "name_en", columnDefinition = "varchar(32)  comment '组织英文名称'")
	private String nameEn;			//英文名称
	
	@Column(name = "code", columnDefinition = "varchar(32)  comment '编号'")
	private String code;			//编码
	
	@Column(name = "parent_id", columnDefinition = "varchar(32)  comment '上级ID'")
	private String parentId;		//上级ID
	
	@Column(name = "head_man", columnDefinition = "varchar(32)  comment '组织负责人'")
	private String headman;			//负责人
	
	@Column(name = "functions", columnDefinition = "varchar(250)  comment '组织职能'")
	private String functions;		//部门职能
	
	@Column(name = "remark", columnDefinition = "varchar(250)  comment '备注'")
	private String remark;				//备注
	
	@Column(name = "address", columnDefinition = "varchar(250)  comment '地址'")
	private	String address;			//地址
	
	@Column(name = "sort", columnDefinition = "int(10)  comment '排序'")
	private	Integer sort;
	
//	@ManyToOne(fetch = FetchType.LAZY)  
//    @JoinColumn(name = "parent_id")
//	private Department department;
//	
//	@OneToMany(targetEntity = Department.class, cascade = { CascadeType.ALL }, mappedBy = "department")  
//    @Fetch(FetchMode.SUBSELECT)  
//    @OrderBy("sort")  
//	private List<Department> subDepartment;
//	
	@Column(name = "depart_url", columnDefinition = "varchar(255)  comment '组织信息地址'")
	private String departUrl;
	
	
//	/**
//	 * 是否有下属部门
//	 * @return
//	 */
//	@Transient
//	public boolean hasChildren(){
//		boolean fg=true;
//		if(subDepartment==null||subDepartment.size()==0){
//			fg= false;
//		}
//		return fg;
//	} 

	
}